import axios from 'axios';
import Qs from 'qs'
////防止Axios同一请求发送两次，会先发送预请求（OPTIONS），也可以后端加配置项，判断为options请求时不做任何处理
axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
axios.defaults.transformRequest = [obj => Qs.stringify(obj)]
//防止出现sessionID不一致的情况
axios.defaults.withCredentials = true

var host = 'http://172.18.245.87:8889';
host='http://10.10.126.252:8889';

export default {
  upload: host + "/basicData/uploadFile",
  imgHost: host + '/img/',
  getUserByUserName(userName) {
    return axios.post(host + "/user/getUserByUserName/" + userName).then(res => res.data);
  },
  getBasicCompany(data) {
    return axios.post(host + "/basicData/getBasicCompany", data).then(res => res.data);
  },
  editBasicCompany(data) {
    return axios.post(host + "/basicData/editBasicCompany", data).then(res => res.data);
  },
  getBasicDepartment(data) {
    return axios.post(host + "/basicData/getBasicDepartment", data).then(res => res.data);
  },
  editBasicDepartment(data) {
    return axios.post(host + "/basicData/editBasicDepartment", data).then(res => res.data);
  },
  getBasicFlowChat(data) {
    return axios.post(host + "/basicData/getBasicFlowChat", data).then(res => res.data);
  },
  editBasicFlowChat(data) {
    return axios.post(host + "/basicData/editBasicFlowChat", data).then(res => res.data);
  },
  getCompanyInformList(data) {
    return axios.post(host + "/basicData/getCompanyInformList", data).then(res => res.data);
  },
  editCompanyInform(data) {
    return axios.post(host + "/basicData/editCompanyInform", data).then(res => res.data);
  },
}